<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Link/index')}">新闻列表</a></li>
        <li><a href="{:url('News/add')}">添加新闻</a></li>
    </ul>
<!--    <form class="well form-inline margin-top-20" method="get" action="{:url('News/index')}">-->
<!--        <input type="text" class="form-control" name="keyword"  value="{:input('request.keyword/s','')}" placeholder="支持标题、作者搜索" style="width: 200px">-->
<!--        <input type="submit" class="btn btn-primary" value="搜索"  style="margin: 10px"/>-->
<!--        <a class="btn btn-danger" href="{:url('News/index')}">清空</a>-->
<!--    </form>-->
<!--    <form method="post" class="js-ajax-form margin-top-20" action="{:url('News/listOrder')}">-->
<!--        <div class="table-actions">-->
<!--            <button class="btn btn-sm btn-primary js-ajax-submit" type="submit">排序</button>-->
<!--            <button class="btn btn-sm btn-success js-ajax-submit" type="submit"-->
<!--                    data-action="{:url('Link/toggle',array('display'=>1))}" data-subcheck="true">显示-->
<!--            </button>-->
<!--            <button class="btn btn-sm btn-danger js-ajax-submit" type="submit"-->
<!--                    data-action="{:url('Link/toggle',array('hide'=>1))}" data-subcheck="true">隐藏-->
<!--            </button>-->
<!--        </div>-->
    <form class="well form-inline margin-top-20" method="get" action="{:url('News/index')}">
        <input type="text" class="form-control" name="keyword" style="width: 120px;" value="{:input('request.keyword','')}" placeholder="支持标题、作者搜索" style="width: 200px">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('News/index')}">清空</a>

    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('News/order')}">
        <div class="table-actions">
            <button type="submit" class="btn btn-primary btn-sm js-ajax-submit">排序</button>
        </div>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label>
                    <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label>
                </th>
                <th width="50">排序</th>
                <th width="50">ID</th>
                <th>标题</th>
                <th>封面图片</th>
                <th>作者</th>
                <th>浏览量</th>
                <th>是否显示</th>
                <th>创建时间</th>
                <th>修改时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
                <foreach name="news" item="v">
                    <tr>
                        <td><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></td>
                        <td><input name='list_orders[{$v.id}]' class="input input-order mr5" type='text' size='3'  style="width: 50px"
                                   value='{$v.list_order}'></td>
                        <td>{$v.id}</td>
                        <td>{$v.title}</td>
                        <td>
<!--                            <a class="img-thumbnail" src="/upload/{$v.image}" />-->
                            <img class="img-thumbnail js-image-previewer" src="/upload/{$v.image}">
                        </td>
                        <td>{$v.author}</td>
                        <td>{$v.look_num}</td>
                        <td>
                            <eq name="$v.switch" value="1">
                                <a href="{:url('News/changeStatus',['id' => $v['id']])}"  class="btn btn-success btn-sm js-ajax-form" data-msg="确定要改为隐藏吗？">是</a>
                                <else>
                                    <a href="{:url('News/changeStatus',['id' => $v['id']])}"  class="btn btn-danger btn-sm js-ajax-form" data-msg="确定要改为隐藏吗？">否</a>
                                </else>
                            </eq>

                        </td>
                        <td>{$v.createtime}</td>
                        <td>{$v.updatetime}</td>
                        <td>
                            <a class="btn btn-xs btn-primary" href="{:url('News/edit',['id' => $v['id']])}">编辑</a>
                            <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('News/del',['id' => $v['id']])}">
                                删除
                            </a>
                            <button onclick="openIframeLayer('{:url("News/detail",['id' => $v['id']])}','预览文章',{width:'60%'})" type="button" class="btn btn-sm btn-default">预览文章</button>
                        </td>
                    </tr>
                </foreach>
            </tbody>
        </table>
        <div class="pagination">
            {$news->render()}
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js?v={$_static_version}"></script>
<script src="__STATIC__/js/js-image-previewer.js"></script>
</body>
</html>
